package com.dylan.channel.v7.channel;


import com.dylan.channel.v7.EventLoop;
import com.dylan.channel.v7.future.ChannelFuture;
import com.dylan.channel.v7.future.ChannelPromise;

import java.net.SocketAddress;

public interface Channel {

    /**
     * Return the {@link EventLoop} this {@link Channel} was registered to.
     * 每个channel都绑定在一个EventLoop中
     */
    EventLoop eventLoop();


    boolean isRegistered();

    /***
     * @Author dylan
     * @Description: 使用channel注册
     * @Create: 2024/9/12 16:23
     */
    void register(EventLoop eventLoop, ChannelPromise channelPromise);


    /**
     * @Author: PP-jessica
     * @Description:该方法并不在此接口，而是在ChannelOutboundInvoker接口，现在先放在这里
     */
    void bind(SocketAddress localAddress, ChannelPromise promise);

}
